<template>
  <div v-if="isShow" class="modal-wrapper">
    <div class="box">
      <span class="close" @click="closeZzc">×</span>
      <div class="head">
        <h3>{{ title }}</h3>
      </div>
      <div class="content">
        <slot name="content"> 这是内容区 </slot>
      </div>
      <div class="footer">
        <slot name="footer"></slot>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["isShow", "title"],
  methods: {
    closeZzc() {
      //   this.$emit("autoClk", false);
      //   this.$emit("update:isShow", false);
      this.$parent.isShow = false;
    },
  },
};
</script>

<style scoped>
.modal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
}

.box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  min-width: 200px;
  padding: 10px 20px;
}

h3 {
  margin: 0;
  text-align: center;
}

.close {
  position: absolute;
  right: 20px;
  cursor: pointer;
}

.content {
  margin-top: 20px;
}

.footer {
  text-align: center;
  margin-top: 30px;
}
</style>